<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="s" uri="http://www.springframework.org/tags" %>
<%@ page isELIgnored="false"%>
<!DOCTYPE html PUBLIC "-//W3C//Dth XHTML 1.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>山西煤炭现货公路交易系统客户端</title>
 <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.5 -->
    <link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/bootstrap/css/bootstrap.min.css">
     <!-- daterange picker -->
    <link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/plugins/daterangepicker/daterangepicker-bs3.css">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/font-awesome/css/font-awesome.min.css">
    <!-- Ionicons -->
    <link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/ionicons/css/ionicons.min.css">
    <!-- jvectormap -->
    <link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/plugins/jvectormap/jquery-jvectormap-1.2.2.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/dist/css/AdminLTE.min.css">
    <link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/dist/css/skins/_all-skins.min.css">
     <!-- DataTables -->
    <link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/plugins/datatables/dataTables.bootstrap.css">
    <!-- AdminLTE Skins. Choose a skin from the css/skins
         folder instead of downloading all of them to reduce the load. -->
    <link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/dist/css/skins/_all-skins.min.css">
	<!-- jQuery 2.1.4 -->
    <script src="<s:url value="/resources"/>/adminlte/plugins/jQuery/jQuery-2.1.4.min.js"></script>
	<!-- Bootstrap 3.3.5 -->
    <script src="<s:url value="/resources"/>/adminlte/bootstrap/js/bootstrap.min.js"></script>
	 <!-- AdminLTE App -->
    <script src="<s:url value="/resources"/>/adminlte/dist/js/app.min.js"></script>
    <!-- Select2 -->
    <link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/plugins/select2/select2.min.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/dist/css/AdminLTE.min.css">
    <!-- date-range-picker -->
    <script src="<s:url value="/resources"/>/adminlte/moment.min.js"></script>
    <script src="<s:url value="/resources"/>/adminlte/plugins/daterangepicker/daterangepicker.js"></script>
    <!-- DataTables -->
    <script src="<s:url value="/resources"/>/adminlte/plugins/datatables/jquery.dataTables.min.js"></script>
    <script src="<s:url value="/resources"/>/adminlte/plugins/datatables/dataTables.bootstrap.min.js"></script>
     <!-- Select2 -->
    <script src="<s:url value="/resources"/>/adminlte/plugins/select2/select2.full.min.js"></script>
    <script src="<s:url value="/resources"/>/adminlte/plugins/select2/i18n/zh-CN.js"></script>
    <!-- 引入 echarts.js -->
    <script src="<s:url value="/resources"/>/echarts/echarts.min.js"></script>
     <script src="<s:url value="/resources"/>/adminlte/default.js"></script>
     <script src="<s:url value="/resources"/>/adminlte/default_settlement.js"></script>
     <script src="<s:url value="/resources"/>/adminlte/plugins/jQueryUI/jquery-ui.js"></script>
     <script type="text/javascript">
 $(function(){  
   // loadUserInfo();
   dataTab("dataTab2",true,false,false,true,true,false,"<s:url value="/resources"/>/adminlte/dataTabBootstrapCN.json");
   dataTab("dataTab3",true,false,false,true,true,false,"<s:url value="/resources"/>/adminlte/dataTabBootstrapCN.json");
   dataTab("dataTab4",true,false,false,true,true,false,"<s:url value="/resources"/>/adminlte/dataTabBootstrapCN.json");
   dataTab("dataTab5",true,false,false,true,true,false,"<s:url value="/resources"/>/adminlte/dataTabBootstrapCN.json");  
   getSelOptsForSettleOnly("<s:url value="/"/>/settlement/getOptionByHavingSelected","selTradername","tradernames","V_KF_JYS_HTJHJSHZ");
   loadMenu("${user.roleType}","${menuid}",${menuList});
   $(".select2").select2();
 });
 function validatePage(){
 	if($("#tradernames")[0].value=="-1"){
 		alert("请选择注册交易商名称");
 		return false;
 	}
 	/* if($("#odwdms").val()==''
 		&&$("#idwdms").val()==''
 		&&$("#oshenfs")[0].selectedIndex==-1
 		&&$("#ohangys")[0].selectedIndex==-1
 		&&$("#ishenfs")[0].selectedIndex==-1
 		&&$("#ihangys")[0].selectedIndex==-1){
 		alert("对不起，请选择至少一项除时间外的查询条件");
 		return false;
 	};
 	 */
 	
 	form1.submit();
 }
     </script>
</head>
<body class="skin-blue sidebar-mini">
<div class="wrapper">
<%@ include file="../../header.jsp" %>
<%@ include file="../../sidebar.jsp" %>
<div class="content-wrapper" >
        <div class="content-header">
          <h1>客服分析<small>交易商信息详情查询</small></h1>
          <ol class="breadcrumb">
            <li><a href="<s:url value="/"/>/index.jsp"><i class="fa fa-dashboard"></i>首页</a></li>
            <li><a href="#" id="location1"></a></li>
            <li class="active" id="location2"></li>
          </ol>
        </div>

        <!-- Main content -->
        <div class="content">
         <!-- 查询条件 -->
         <form action="<s:url value="/"/>/callCenterService/getTraderDetailInfo" method="post" name="form1" id='form1'>
         <input type="hidden" value="${type}" name="type"/>
         <input type="hidden" value='${selTradername}' name="selTradername" id ="selTradername"/>
          <div class="box box-success">
            <div class="box-header with-border">
              <h3 class="box-title">查询条件</h3>
              <div class="box-tools pull-right">
                <button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
                <!-- <button class="btn btn-box-tool" data-widget="remove"><i class="fa fa-remove"></i></button> -->
              </div>
            </div><!-- /.box-header -->
            <div class="box-body">
              <div class="row">
              	 <div class="col-md-6">
                 <!-- Date range -->
                 <div class="form-group">
                    <label>注册交易商名称</label><span class="must"> *</span>
                    <select class="form-control select2" style="width: 100%;"  id="tradernames" name="tradernames"  data-placeholder="请选择注册交易商名称" >
                    </select>
                      <%--<input type="text" class="form-control pull-right" id="tradername" name="tradername" value="${tradername}"/>
                    --%></div>
               </div>
               <div class="col-md-6">
                  <div class="form-group">
                  	 <label>&nbsp;</label>
                  	 <div class="input-group">
                      <button class="btn btn-primary"  type="button" onclick="validatePage()">查询</button>
                      </div>
                  </div>
                </div><!-- /.col -->
              </div><!-- /.row -->
            </div><!-- /.box-body -->
          </div><!-- /.box -->
          </form>
          
          <div class="box">
                <div class="box-header">
                  <h3 class="box-title">交易商信息
                  </h3>
                  <div class="box-tools pull-right">
                <button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
                <!-- <button class="btn btn-box-tool" data-widget="remove"><i class="fa fa-remove"></i></button> -->
              </div>
                </div><!-- /.box-header -->
                
                <div class="box-body">
                  <table id="dataTab1" class="table table-bordered table-hover">
                   	<tbody>
                   		<c:forEach items="${resultlist1}" var="list1">
                   			<tr>
                   				<th style="text-align: right">交易商名称</th>
                   				<td>${list1.fullname}</td>
                   				<th style="text-align: right">交易商类型</th>
                   				<td><c:if test="${list1.maimlx eq '买方'}">消费企业</c:if>
                   					<c:if test="${list1.maimlx eq '卖方'}">生产企业</c:if>
                   					<c:if test="${list1.maimlx eq '中间商'}">经营企业</c:if>
                   					<c:if test="${list1.maimlx ne '中间商'&& list1.maimlx ne '卖方' && list1.maimlx ne '买方'}">${list1.maimlx}</c:if>
                   				</td>
                   				<th style="text-align: right">行业</th>
                   				<td>${list1.hangylx}</td>
                   			</tr>
                   			<tr>
                   				<th style="text-align: right">地区</th>
                   				<td>${list1.shengfmc}</td>
                   				<th style="text-align: right">城市</th>
                   				<td>${list1.chengshmc}</td>
                   				<th style="text-align: right">交易范围</th>
                   				<td></td>
                   			</tr>
                   			<tr>
                   				<th style="text-align: right">2015年交易量（万吨）</th>
                   				<td align="right"><c:if test="${list1.maimlx eq '买方'}">${list1.buym2015/10000.00}</c:if>
                   					<c:if test="${list1.maimlx eq '卖方'}">${list1.salem2015/10000.00}</c:if>
                   					<c:if test="${list1.maimlx eq '中间商'}">${(list1.buym2015+list1.salem2015)/10000.00}</c:if>
                   				</td>
                   				<th style="text-align: right">2015年发运量（万吨）</th>
                   				<td align="right">${list1.fayds2015/10000.00}</td>
                   				<th style="text-align: right">2015年结算量（万元）</th>
                   				<td align="right">${(list1.xianj2015+list1.chengd2015)/10000.00}</td>
                   			</tr>
                   			<tr>
                   				<th style="text-align: right">2016年交易量（万吨）</th>
                   				<td align="right"><c:if test="${list1.maimlx eq '买方'}">${list1.buym2016/10000.00}</c:if>
                   					<c:if test="${list1.maimlx eq '卖方'}">${list1.salem2016/10000.00}</c:if>
                   					<c:if test="${list1.maimlx eq '中间商'}">${(list1.buym2016+list1.salem2016)/10000.00}</c:if>
                   				</td>
                   				<th style="text-align: right">2016年发运量（万吨）</th>
                   				<td align="right">${list1.fayds2016/10000.00}</td>
                   				<th style="text-align: right">2016年结算量（万元）</th>
                   				<td align="right">${(list1.xianj2016+list1.chengd2016)/10000.00}</td>
                   			</tr>
                   			<tr>
                   				<th style="text-align: right">2017年交易量（万吨）</th>
                   				<td align="right"><c:if test="${list1.maimlx eq '买方'}">${list1.buym2017/10000.00}</c:if>
                   					<c:if test="${list1.maimlx eq '卖方'}">${list1.salem2017/10000.00}</c:if>
                   					<c:if test="${list1.maimlx eq '中间商'}">${(list1.buym2017+list1.salem2017)/10000.00}</c:if>
                   				</td>
                   				<th style="text-align: right">2017年发运量（万吨）</th>
                   				<td align="right">${list1.fayds2017/10000.00}</td>
                   				<th style="text-align: right">2017年结算量（万元）</th>
                   				<td align="right">${(list1.xianj2017+list1.chengd2017)/10000.00}</td>
                   			</tr>                   			
                   		</c:forEach>
                   	</tbody>
                  </table>
                </div><!-- /.box-body -->
              </div><!-- /.box -->
          
          <div class="box">
                <div class="box-header">
                  <h3 class="box-title">三员信息
                  </h3>
                  <div class="box-tools pull-right">
                <button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
                <!-- <button class="btn btn-box-tool" data-widget="remove"><i class="fa fa-remove"></i></button> -->
              </div>
                </div><!-- /.box-header -->
                
                <div class="box-body">
                  <table id="dataTab2" class="table table-bordered table-hover">
                  <c:if test="${resultlist2 ne null}">
                  	<thead>
                  		<tr>
                  			<th style="text-align: center">姓名</th>
                  			<th style="text-align: center">手机</th>
                  			<th style="text-align: center">座机</th>
                  			<th style="text-align: center">角色</th>
                  		</tr>
                  	</thead>
                   	<tbody>
                   		<c:forEach items="${resultlist2}" var="list2">
                   			<tr>
                   				<td  style="text-align: left">${list2.username}</td>
                   				<td  style="text-align: center">${list2.mobile}</td>
                   				<td  style="text-align: center">${list2.telephone}</td>
                   				<td  style="text-align: left">${list2.rolename}</td>
                   			</tr>
                   		</c:forEach>
                   	</tbody>
                   	</c:if>
                  </table>
                </div><!-- /.box-body -->
              </div>
              
              <div class="box">
                <div class="box-header">
                  <h3 class="box-title">交易商产品汇总信息
                  </h3>
                  <div class="box-tools pull-right">
                <button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
                <!-- <button class="btn btn-box-tool" data-widget="remove"><i class="fa fa-remove"></i></button> -->
              </div>
                </div><!-- /.box-header -->
                
                <div class="box-body">
                  <table id="dataTab3" class="table table-bordered table-hover">
                  <c:if test="${resultlist3 ne null}">
                  	<thead>
                  		<tr>
                  			<th style="text-align: center">编号</th>
                  			<th style="text-align: center">煤种</th>
                  			<th style="text-align: center">品种</th>
                  			<th style="text-align: center">质量指标</th>
                  			<th style="text-align: center">单价</th>
                  			<th style="text-align: center">数量</th>
                  			<th style="text-align: center">年份</th>
                  		</tr>
                  	</thead>
                   	<tbody>
                   		<c:set value="1" var="i"></c:set>
                   		<c:forEach items="${resultlist3}" var="list3">
                   			<tr>
                   				<td  style="text-align: center">${i}<c:set var="i" value="${i+1}"></c:set></td>
                   				<td  style="text-align: left">${list3.meiz}</td>
                   				<td  style="text-align: left">${list3.pinz}</td>
                   				<td  style="text-align: left">${list3.zhilzb}</td>
                   				<td  style="text-align: right">${list3.jiag}</td>
                   				<td  style="text-align: right">${list3.shul}</td>
                   				<td  style="text-align: center">${list3.nianf }</td>
                   			</tr>
                   		</c:forEach>
                   	</tbody>
                   	</c:if>
                  </table>
                </div><!-- /.box-body -->
              </div>
              
              <div class="box">
                <div class="box-header">
                  <h3 class="box-title">交易合同信息
                  </h3>
                  <div class="box-tools pull-right">
                <button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
                <!-- <button class="btn btn-box-tool" data-widget="remove"><i class="fa fa-remove"></i></button> -->
              </div>
                </div><!-- /.box-header -->
                
                <div class="box-body">
                  <table id="dataTab4" class="table table-bordered table-hover">
                  <c:if test="${resultlist4 ne null}">
                  	<thead>
                  		<tr>
                  			<th style="text-align: center">编号</th>
                  			<th style="text-align: center">出卖人</th>
                  			<th style="text-align: center">买受人</th>
                  			<th style="text-align: center">煤种</th>
                  			<th style="text-align: center">品种</th>
                  			<th style="text-align: center">质量指标</th>
                  			<th style="text-align: center">年份</th>
                  			<th style="text-align: center">合同类型</th>
                  			<th style="text-align: center">数量</th>
                  		</tr>
                  	</thead>
                   	<tbody>
                   		<c:set value="1" var="j"></c:set>
                   		<c:forEach items="${resultlist4}" var="list4">
                   			<tr>
                   				<td  style="text-align: center">${j}<c:set var="j" value="${j+1}"></c:set></td>
                   				<td  style="text-align: left">${list4.chumdwmc}</td>
                   				<td  style="text-align: left">${list4.maisdwmc}</td>
                   				<td  style="text-align: left">${list4.meiz}</td>
                   				<td  style="text-align: left">${list4.pinz}</td>
                   				<td  style="text-align: left">${list4.zhilzb}</td>
                   				<td  style="text-align: center">${list4.nianf}</td>
                   				<td  style="text-align: left">${list4.dicnname}</td>
                   				<td  style="text-align: right">${list4.shul}</td>
                   			</tr>
                   		</c:forEach>
                   	</tbody>
                   	</c:if>
                  </table>
                </div><!-- /.box-body -->
              </div>
              
              <div class="box">
                <div class="box-header">
                  <h3 class="box-title">交易合同收发货信息
                  </h3>
                  <div class="box-tools pull-right">
                <button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
                <!-- <button class="btn btn-box-tool" data-widget="remove"><i class="fa fa-remove"></i></button> -->
              </div>
                </div><!-- /.box-header -->
                
                <div class="box-body">
                  <table id="dataTab5" class="table table-bordered table-hover">
                  <c:if test="${resultlist5 ne null}">
                  	<thead>
                  		<tr>
                  			<th style="text-align: center">编号</th>
                  			<th style="text-align: center">发货单位</th>
                  			<th style="text-align: center">发站</th>
                  			<th style="text-align: center">收货单位</th>
                  			<th style="text-align: center">到站</th>
                  			<th style="text-align: center">数量</th>
                  			<th style="text-align: center">时间</th>
                  		</tr>
                  	</thead>
                   	<tbody>
                   		<c:set value="1" var="m"></c:set>
                   		<c:forEach items="${resultlist5}" var="list5">
                   			<tr>
                   				<td  style="text-align: center">${m}<c:set var="m" value="${m+1}"></c:set></td>
                   				<td  style="text-align: left">${list5.fahdwmc}</td>
                   				<td  style="text-align: left">${list5.fazmch}</td>
                   				<td  style="text-align: left">${list5.shouhdwmc}</td>
                   				<td  style="text-align: left">${list5.daozmch}</td>
                   				<td  style="text-align: right">${list5.shul}</td>
                   				<td  style="text-align: center">${list5.nianf }</td>
                   			</tr>
                   		</c:forEach>
                   	</tbody>
                   	</c:if>
                  </table>
                </div><!-- /.box-body -->
              </div>

        </div><!-- /.content -->
      </div><!-- /.content-wrapper -->
</div>  
</body>
</html>
